package cn.iocoder.yudao.module.member.dal.mysql.praxisAnnex;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.member.controller.admin.praxisProject.vo.PraxisAnnexVO;
import cn.iocoder.yudao.module.member.dal.dataobject.praxisAnnex.PraxisAnnexDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 项目附件 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface PraxisAnnexMapper extends BaseMapperX<PraxisAnnexDO> {

    default List<PraxisAnnexDO> selectList(PraxisAnnexVO reqVO) {
        return selectList(new LambdaQueryWrapperX<PraxisAnnexDO>()
                .likeIfPresent(PraxisAnnexDO::getAnnexName, reqVO.getAnnexName())
                .eqIfPresent(PraxisAnnexDO::getAnnexUrl, reqVO.getAnnexUrl())
                .eqIfPresent(PraxisAnnexDO::getRelationId, reqVO.getRelationId())
                .eqIfPresent(PraxisAnnexDO::getRelationType, reqVO.getRelationType())
                .orderByAsc(PraxisAnnexDO::getId));
    }
    List<PraxisAnnexVO> getPraxisAnnexListByProjectId(@Param("relationId") Long relationId, @Param("relationType") Integer relationType);
}
